import Vue from 'vue'
import VueRouter from 'vue-router'
import login from "../views/login"
import HelloWorld from "../components/Home"
import Welcome from "../views/welcome"

Vue.use(VueRouter)

const routes = [
  {
    name: "login",
    path: "/login",
    component: login
  },
  {
    name: "HelloWorld",
    path: "/",
    component: HelloWorld,
    redirect: "/welcome",
    children: [
      {
        name: "welcome",
        path: "/welcome",
        component: Welcome,
      },
      {
        name: "user",
        path: "/users",
        component: ()=>import('../views/users.vue'),
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
